package com.zlc.study.controller;

import com.zlc.study.service.ChatAssistant;
import dev.langchain4j.model.chat.ChatModel;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PopularIntegrationController {
    @Resource
    private ChatModel chatModel;
    @GetMapping("/hello")
    public String hello(@RequestParam(value = "hello",defaultValue = "你是谁？")String hello) {
        System.out.println("通过langchain4j调用模型返回结果：\n" + chatModel.chat(hello));
        return chatModel.chat(hello);
    }
}
